/************************************************************
 * Copyright (C), 2022-2030, ripnano. Co., Ltd.
 * FileName:        form_factory_params.h
 * Author:          Dan Yin
 * Date:            2024-07-11
 * Description:     the class of factory params setting
 * Version:         1.0.0.0
 **********************************************************/

#ifndef FORM_FACTORY_PARAMS_H
#define FORM_FACTORY_PARAMS_H

// add necessary includes here
#include "ui/defines/global.h"

struct ST_CFG_MOTOR_PARAMS_T1C;
namespace Ui {
class FormFactoryParams;
}

class FormFactoryParams : public QWidget
{
    Q_OBJECT

public:
    // Get an instance of "FormFactoryParams" class, if exist, return it
    static FormFactoryParams* getInstance(QWidget *pParent = nullptr);

signals:
    // The signal that refresh UI info
    void signalRefreshUI(int nType);

private slots:
    // The slot that refresh UI info
    void slotRefreshUI(int nType);

    // Save configuration info
    void on_pushButton_Modify_clicked();

    void on_horizontalSlider_High_valueChanged(int value);

    void on_horizontalSlider_Medium_valueChanged(int value);

    void on_horizontalSlider_Low_valueChanged(int value);

protected:
    // Triggers an event before it is switch language
    void changeEvent(QEvent *event);

private:
    // The default constructor
    explicit FormFactoryParams(QWidget *parent = nullptr);

    // The default destructor
    virtual ~FormFactoryParams();

    // After constructing object, initialize the object
    void _initObj();

    // Init the window style
    void _initUi();

    // Update golobal public variables from struct
    void _updatePublicVariables(struct ST_CFG_MOTOR_PARAMS_T1C &stCfgMotorParams);

private:
    Ui::FormFactoryParams *ui;

    int     m_nType = 0;
};

#endif // FORM_FACTORY_PARAMS_H
